#import "gnuviewController.h"
#import "Controller.h"

@implementation gnuviewController

- window
{
	return window;
}

- gnuView
{
	return gnuView;
}

- windowWillClose:sender
{
	[sender setDelegate: nil];
	if ([controller activeTerm] == self) {
		[controller setActiveTerm:nil];
	}
	return self;
}

- windowDidBecomeMain:sender
{
	[controller setKeyTerm:self];
	
	return self;
}

- activatePushed:sender
{	
	if ([sender state] == 1) {
		[controller setActiveTerm: self];
		[sender setTitle:"--- ACTIVE ---"];		
	}
	else {
		[controller setActiveTerm:nil];
		[sender setTitle:"Activate"];
	}
		
	return self;
}

- deactivate:sender
{
	[activateButton setState:0];
	[activateButton setTitle:"Activate"];
			
	return self;
}

- activate:sender
{
	[activateButton setState:1];
	[activateButton setTitle:"--- ACTIVE ---"];
			
	return self;
}


@end
